<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    </style>
</head>

<body>
    <div>这是div</div>
    <input type="text">
    <input type="button" value="按钮" onclick="f()">
    <script>
        function f() {
            let d = document.querySelector("div");
            let i = document.querySelector("input");
            d.innerHTML = i.value;
        }
    </script>



</body>

</html>